//
//  MineFooterView.m
//  QXShowing
//
//  Created by 王道道 on 2018/4/19.
//  Copyright © 2018年 doll_dream. All rights reserved.
//

#import "MineFooterView.h"

//@interface MineFooterView() <BaseProtocol>
//
//@end

@implementation MineFooterView

- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = Bg_Color_F9F9F9;
        [self setUpUI];
        [self _viewLzyout];
    }
    return self;
}

- (void)setUpUI {
    self.nameButton = [[UIButton alloc]init];
    [self.nameButton setTitle:@"请登录" forState:UIControlStateNormal];
    self.nameButton.backgroundColor = Bg_Color_333333;
    [self.nameButton setTitleColor:Text_Color_FFFFFF forState:UIControlStateNormal];
    self.nameButton.titleLabel.font = [UIFont boldSystemFontOfSize:18 * SizeScale];
    [self.nameButton addTarget:self action:@selector(nameButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    
    self.nameButton.layer.masksToBounds = YES;
    self.nameButton.layer.cornerRadius = 10;
    
    [self addSubview:self.nameButton];
    
//    UIButton *button = [[UIButton alloc] init];
//    //    [button setTitle:@"" forState:UIControlStateNormal];
//    [button addTarget:self action:@selector(nameButtonClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self addSubview:button];
//    [button mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.headImage.mas_top);
//        make.bottom.equalTo(self.nameButton.mas_bottom);
//        make.left.equalTo(self.headImage.mas_left);
//        make.centerX.equalTo(self.mas_centerX);
//
//    }];
}

- (void)_viewLzyout {
    [self.nameButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.centerX.equalTo(self);
        make.height.offset(55);
        make.bottom.equalTo(self.mas_bottom);
//        make.bottom.equalTo(self.mas_bottom).offset(-10);
    }];
}

//- (void)setInfoModel:(PersonalInfoModel *)infoModel {
//    if (![BHSettingUtil dataAndStringIsNull:infoModel]) {
//        [self.nameButton setTitle:[BHSettingUtil dataAndStringIsNull:infoModel.company_name] ? @"登录/注册" : infoModel.company_name forState:UIControlStateNormal];
//        self.nextImage.hidden = self.addressLabel.hidden = [BHSettingUtil dataAndStringIsNull:infoModel.company_name];
//        [self.headImage sd_setImageWithURL:[NSURL URLWithString:infoModel.UserPhoto] placeholderImage:[UIImage imageNamed:@"icon_default_portrait"]];
//    }
//}

#pragma mark - 按钮
- (void)nameButtonClick:(UIButton *)sender {
    if (self.baseProtocol && [self.baseProtocol respondsToSelector:@selector(logoutProtocol)]) {
        [self.baseProtocol logoutProtocol];
    }
}
//
//- (void)personalClick:(UIButton *)sender {
//    if (self.homeProtocol && [self.homeProtocol respondsToSelector:@selector(homeColumnView:didSelect:)]) {
//        [self.homeProtocol homeColumnView:self didSelect:1];
//    }
//}


@end
